<?php defined('_JEXEC') or die('Restricted access'); ?>

<?php if ( $this->params->get( 'show_page_title', 1 ) ) : ?>
	<div class="componentheading<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>">
		<?php echo $this->escape($this->params->get('page_title')); ?>
	</div>
<?php endif; ?>
<div class="cat-igallery">
<?php if(count($this->categories) > 0){?>
	<?php foreach($this->categories as $item){?>
	<?php 
	if( !empty($item->menu_image_filename) ){
		if(! $fileArray = igFileHelper::originalToResized($item->menu_image_filename, $item->menu_max_width, 
		$item->menu_max_height, $item->img_quality, $item->crop_menu, 0, $item->round_menu, $item->round_fill) )   {
			return false;
		}
		$folderName = $fileArray['folderName'];
		$fullFileName = $fileArray['fullFileName'];
		$image = IG_IMAGE_HTML_RESIZE . $folderName .'/'. $fullFileName;
	}else{
		$image = 'images/noimage.jpg';
	}
	$detail 	= JRoute::_('index.php?option=com_igallery&amp;view=igcategory&amp;cid[]='.$item->slug.'&Itemid='.$this->Itemid);
	?>
		<div class="cat-igallery-item">
			<p class="item_img"><a href="<?php echo $detail?>">
				<img src="<?php echo $image;?>" alt="" width="<?php echo $item->menu_max_width?>">
			</a></p>
			<p class="item_name"><?php echo $item->name?></p>
			<p class="item_date"><span><?php echo JText::_('CAP_NHAT');?></span> <?php echo $item->date?></p>
			<p class="item_view"><span><?php echo JText::_('LUOT_XEM');?></span> <?php echo $item->hits?></p>
		</div>
	
	<?php } ?>
	<div>
		<?php echo $this->pagination->getPagesLinks(); ?>
	</div>
	
<?php }else{?>
	<?php echo JText::_('DATA_EMPTY');?>
<?php } ?>

</div>


